package pl.edu.agh.anomalyids.lerad.aspect.enums;

public enum IPPool {
	PRIVATE, PUBLIC;
	
	private static String pattern = "(^127\\.0\\.0\\.1)|(^10\\..+)|(^172\\.1[6-9]\\..+)|(^172\\.2[0-9]\\..+)|(^172\\.3[0-1]\\..+)|(^192\\.168\\..+)"; 

	public static IPPool getValue(String ip) {
		return (ip.matches(pattern) ? IPPool.PRIVATE : IPPool.PUBLIC);
	}
}
